package spring.transaction;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TransactionalTest implements TransactionalInterface{

    @Override
    @Transactional
    public void transactionalTest1(JdbcTemplate jdbcTemplate){
//        String sql = "select count(*) from student for update";
        String sql = "update student set group_id = 12 where id = 1";
        jdbcTemplate.update(sql);
        System.out.println("ok");
    }
}